<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
	isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/locale/easyui-lang-zh_CN.js"></script>
<link href="<%=request.getContextPath()%>/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/jPages.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/animate.css">
<script src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jPages.js"></script>
<script type="text/javascript">
$(function(){  
	$("div.holder").jPages({  
	  containerID : "item", 
	  first:"首页", 
	  previous : "上一页",  
	  next : "下一页",
	  last:"尾页",  
	  perPage : 10,  
	  //delay : 100,
	  //动画效果
	  //animation:"bounceInLeft"
	});  
 });  
</script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
 	 $(".tip").fadeIn(200);
  });
  
  $(".sure").click(function(){
 	 $(".tip").fadeOut(100);
  });

  $(".cancel").click(function(){
	  $(".tip").fadeOut(100);
	  $(".jiefeng").fadeOut(100);
  });
});
</script>
</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><ema href="javascript:void">首页</em></li>
			<li><ema href="javascript:void">用户管理</em></li>
			<li><ema href="javascript:void">企业用户列表</em></li>
		</ul>
	</div>
	<div class="rightinfo">
		<div class="tools">
			<form  style="    font-size: 16px;" action="<%=request.getContextPath()%>/selectUserCompanyList" method="post" name="serch">
				<td class="zi">注册时间：</td>
				<td><input type="date" name="startTime" style="    height: 20px; border:1px solid red;"/>至<input type="date" name="endTime" style=" height: 20px; border:1px solid red;"/></td>
				<td class="zi">昵称：</td>
				<td><input type="text" id="mapname" name="mapname" style="    height: 20px; border:1px solid red;"/></td>
				<td class="zi">手机号：</td>
				<td><input type="text" id="mobile" name="mobile" style="    height: 20px; border:1px solid red;"/></td>
				<td class="zi">城市：</td>
				<td><input type="text" id="addres" name="addres" style="    height: 20px;border:1px solid red;"/></td>
				<td class="zi">账号是否封号：</td>
				<td><select name="isUser" style="width: 90px;height: 24px;">
								<option selected="selected"  value=" ">请选择</option>
								<option value="1">否</option>
								<option value="0">是</option>
						</select></td>
			
			<div class="toolbar1">
				<table>
					<tr style="border: 0px ">
						<td><input type="submit" value="查询" class="button" /></td>
					</tr>
				</table>
			</div>
			</form>
		</div>
		<ul class="toolbar">
				<li class="exportExcel"><span><img src="<%=request.getContextPath()%>/images/t04.png" /></span>导出</li>
<%-- 								<li class="backups"><span><img src="<%=request.getContextPath()%>/images/t01.png" /></span>备份</li>
							<li class="recovery"><span><img src="<%=request.getContextPath()%>/images/t02.png" /></span>恢复</li> --%>
			</ul>
		<table class="tablelist">
			<thead>
				<tr>
					<th>头像</th>
					<th>昵称</th>
					<th>手机号</th>
					<th>ID</th>
					<th>性别</th>
					<th>用户等级</th>
					<th>实名认证</th>
					<th>企业认证</th>
					<th>会员</th>
					<th>所在地</th>
					<th>注册时间</th>
					<th>最近登录时间</th>		
					<th>操作</th>
				</tr>
			</thead>
			<tbody class="tb" id="item">
				<c:forEach items="${lists}" var="data">
					<tr>
						<td><img style="width: 80px;height: 80px;" src="${data.photo}" alt="" /> </td>
						<td>${data.username}</td>
						<td>${data.mobile}</td>
						<td>${data.id}</td>
							<td>
							<c:if test="${data.gender == 1}">男</c:if>
							<c:if test="${data.gender == 2}">女</c:if>
							<c:if test="${data.gender == 0}">未知</c:if>
						</td>
						<td>${data.integral_rank}</td>
						<td>
							<c:if test="${data.audit == 1}">已认证</c:if>
							<c:if test="${data.audit == 2}">未认证</c:if>
							<c:if test="${data.audit == 0}">未认证</c:if>
							<c:if test="${data.audit == null}">未认证</c:if>
						</td>
						<td>
							<c:if test="${data.enteraudit == 1}">已认证</c:if>
							<c:if test="${data.enteraudit == 2}">未认证</c:if>
							<c:if test="${data.enteraudit == 0}">未认证</c:if>
								<c:if test="${data.enteraudit == null}">未认证</c:if>
						</td>
 						<td>	<c:if test="${data.vip == 1}">VIP1</c:if>
							<c:if test="${data.vip == 2}">企业VIP</c:if>
							<c:if test="${data.vip == 3}">VIP2</c:if>
							<c:if test="${data.vip == null}">普通用户</c:if></td>
						<td>${data.address}</td>
						<td>${data.create_time}</td>
						<td>${data.login_time}</td>
						<td>
							<ul class="toolbar"style=" margin-left: 49px;">
						<li style="width: 33px;"><a style=" margin-left: 9px;"href="<%=request.getContextPath()%>/selectUserCompanyList?mapid=${data.id}" >查看</a></li>
						<li style="    margin-left: 20px; width: 93px;"><a style=" margin-left: 9px;"href="<%=request.getContextPath()%>/selectEntUserOrderList?mapid=${data.id}" >企业服务情况</a></li>
						<c:if test="${data.is_ban == 1}">	<li style="margin-left: 20px; width: 33px;"><strong onclick="update(this)" style="    margin-left: 6px;">封号</strong></li></c:if>
					<c:if test="${data.is_ban == 0}">	<li style="margin-left: 20px; width: 33px;">  <strong onclick="update(this)" style="    margin-left: 6px;">解封</strong></li></c:if>
						<%-- <li style="margin-left: 20px; width: 93px;"><a style=" margin-left: 9px;"href="/htx-backer/selectCompanyList?userid=${data.id}" >通过审核</a></li> --%>
						</ul>
						</td>
						<input name="userid" type="hidden" value="${data.id}"/>
						<input name="username" type="hidden" value="${data.username}"/>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div style="clear:both;"></div>
		<!-- 分页的页码 -->
		<div class="holder"></div>
		共${nums}条记录
		<div class="tip">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认审核通过 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
		
			<div class="tip">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认封号 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
		<div class="jiefeng" style="width:485px; height:260px; position:absolute;top:10%; left:30%;background:#fcfdfd;box-shadow:1px 8px 10px 1px #9b9b9b;border-radius:1px;behavior:url(js/pie.htc); display:none; z-index:111111;">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认解封 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
	</div>
	<script type="text/javascript">
	
	 $(".exportExcel").click(function(){
		 window.location.href = "<%=request.getContextPath()%>/enterpriseExportExcel?startTime="+ $("input[name=startTime]").val()+"&endTime="+$("input[name=endTime]").val()+"&mapname="+$("input[name=mapname]").val()+"&mobile="+$("input[name='mobile']").val()+"&addres="+$("input[name=addres]").val()+"&isUser="+$("select[name=isUser]").val();
	 })
	 
		$('.tablelist tbody tr:odd').addClass('odd');

	  function update(a){
		  var text = $(a).text();
		  var statu = "";
		  if(text == "封号"){
			  $(".tip").fadeIn(500);
			  statu = "0";
		  }else if(text == "解封"){
			  $(".jiefeng").fadeIn(500);
			  statu = "1";
		  }
		  $(".sure").click(function(){
			  var username = $(a).parent().parent().parent().parent().find("input[name=username]").val();
			var params = $(a).parent().parent().parent().parent().find("input[name=userid]").val()+ "," + statu + "," + username;;
			params+=",enter"; 
			window.location.href="<%=request.getContextPath()%>/updateUserStatu?params="+params;
	     });
	  }

	  $(".backups").click(function(){
		  $.ajax({
  				type:"get",
  				url:"/htx-backer/backups", 
  				data:{
  					name:"enterprise_certification"
  				},
  				success:function(data){
  					if(data == "OK"){
  					 	alert("备份成功!");
  					}else{
  						alert("备份失败!");
  					}
  					
  				}
			}) 
	 })
	  $(".recovery").click(function(){
		  $.ajax({
  				type:"get",
  				url:"/htx-backer/recovery", 
  				data:{
  					name:"enterprise_certification"
  				},
  				success:function(data){
  					if(data == "OK"){
  					 	var btn = confirm("恢复成功,点击确定刷新列表!")
  					 	if(btn == true){
		   					window.location.href="<%=request.getContextPath()%>/selectUserCompanyList";
  					 	}
  					}else{
  						alert("恢复失败!");
  					}
  				}
			}) 
	 })
	  </script>
	
</body>
</html>
